package com.service.product.controller;

import com.model.product.pojo.entity.Product;
import com.service.product.service.ProductService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/product")
@RestController
public class ProductController {
    @Resource
    private ProductService productService;

    /**
     * 根据id查询商品信息
     *
     * @param id
     */
    @GetMapping("/getProductById/{id}")
    public Product getProductById(@PathVariable("id") Long id) {
        return productService.getProductById(id);
    }

}
